﻿@{
    ViewBag.Title = "SetStockName";
}
@section scripts
{   
    <script src="@Url.Content("~/Scripts/shared/share.js")" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/shared/shown.js")" type="text/javascript"></script>   
    <script src="@Url.Content("~/Scripts/shared/share.js")" type="text/javascript"></script> 
    <link href="@Url.Content("~/content/css/kingprt.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/content/css/bootstrap.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/content/css/KingcensSet.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/content/css/font-awesome.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.PrintArea.js")" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/Base/print.js")" type="text/javascript"></script> 
}
<form id="form1" runat="server" method="post" style = "width:100%;height:100%">
        <table width = "400px" style="margin-left:90px;">
            <tr>
                <td width="100px" height ="50px" align="right" class="fonthsx"></td>
                <td width="200px">
                </td>
            </tr>
            <tr>
                <td height ="50px" align="right" class="fonthsx"><font color="#FF0000" size ="5" >提示：</td>
                <td >
                    <font color="#FF0000" size ="5" ><span id="FActionMsg">第一次登录请修改门店名称</span></font>
                </td>
            </tr>
            <tr>
                <td height="50px" align="right" class="fonthsx">门店名称：</td>
                <td>
                    <input id="FStockName"  type="text" class="form-control" placeholder="请输入门店名称">
                </td>
                <td style="padding-left:5px;">
                    
                </td>
            </tr>
            <tr>
                <td height="50px" align="right" class="fonthsx">联系电话：</td>
                <td>
                    <input id="FPhone"  type="text" class="form-control" placeholder="请输入联系电话">
                </td>
                <td style="padding-left:5px;">
                    
                </td>
            </tr>
            <tr>
                <td height="50px" align="right" class="fonthsx">门店地址：</td>
                <td>
                    <input id="FAddress"  type="text" class="form-control" placeholder="请输入门店地址">
                </td>
                <td style="padding-left:5px;">
                    
                </td>
            </tr>
        </table>
        <table width = "450px" style="margin-left:20px;margin-top:20px">
            <tr>
                <td width="250px" height="50px" align="right">
                    <input type="button" id="ActionBtn" value="确认"  class="btn btn-default" style="width:90px;"/>
                </td>
                <td width="200px" height="50px" align="right" style="padding-left:5px;">
                    <input type="button" id="CancelBtn" value="关闭"  class="btn btn-default" style="width:90px;"/>
                </td>
            </tr>
        </table>
<script>
    function FormShown() {
    }

    $(function () {
        $("#ActionBtn").bind("click", Action);
        $("#CancelBtn").bind("click", CloseWindow);
    });

    var Action = function () {
        if ($("#FStockName").val().length == "") {
            mini.alert("门店名称未输入");
            return;
        }
        $("#ActionBtn").addClass("disabled");
        var jsonstr = '[{"StockName":"' + $("#FStockName").val() + '",'
            + '"FPhone":"' + $("#FPhone").val() + '",'
            + '"FAddress":"' + $("#FAddress").val() + '",'
            + '"mSystemAppID":"' + parent.window.getSystemAppID() + '"}]';
        $.post("EditStock", { mjson: jsonstr }, function (data) {
            var ret = mini.decode(data);
            if (ret.status == 1) {
                mini.alert("门店名称修改成功,请重新登录");
            }
            else {
                mini.alert("门店名称修改失败," + ret.error);
            }
        })
    }

</script>
</form>
